(function ($) {
    $.fn.SocialCounter = function (options) {

        var defaults = {
            SosSite: ' ',
            BName: ' ',
        };

        var options = $.extend(defaults, options);
        var selector = this;

        return this.each(function () {

            if (options.SosSite == "Twitter") {
                var Twitterurl = 'http://api.twitter.com/1/statuses/user_timeline/' + options.bName + '.json?callback=?';
                $.getJSON(Twitterurl, function (count) {
                    $(selector).html(count[0].user.followers_count);
                });
            }

            if (options.SosSite == "Facebook") {
                var Facebookurl = 'https://api.facebook.com/method/fql.query?query=select like_count from link_stat where url="' + options.bName + '"&format=json&callback=?';
                $.getJSON(Facebookurl, function (LikeCount) {
                    $(selector).html(LikeCount[0].like_count);
                });

            }


        });
    };
})(jQuery);